<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>游戏平台管理系统</title>
    <meta name="description" content="Ela Admin - HTML5 Admin Template">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://www.jq22.com/jquery/bootstrap-4.2.1.css">
    <link rel="stylesheet" href="https://www.jq22.com/jquery/font-awesome.4.7.0.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/normalize.css@8.0.0/normalize.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lykmapipo/themify-icons@0.1.2/css/themify-icons.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pixeden-stroke-7-icon@1.2.3/pe-icon-7-stroke/dist/pe-icon-7-stroke.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.2.0/css/flag-icon.min.css">
    <link rel="stylesheet" href="/assets/css/cs-skin-elastic.css">
    <link rel="stylesheet" href="/assets/css/style.css">
    <link href="https://cdn.jsdelivr.net/npm/chartist@0.11.0/dist/chartist.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/jqvmap@1.5.1/dist/jqvmap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/weathericons@2.1.0/css/weather-icons.css" rel="stylesheet" />
    <link href="https://cdn.jsdelivr.net/npm/fullcalendar@3.9.0/dist/fullcalendar.min.css" rel="stylesheet" />

    <style>
        #weatherWidget .currentDesc {
            color: #ffffff!important;
        }
        .traffic-chart {
            min-height: 335px;
        }
        #flotPie1  {
            height: 150px;
        }
        #flotPie1 td {
            padding:3px;
        }
        #flotPie1 table {
            top: 20px!important;
            right: -10px!important;
        }
        .chart-container {
            display: table;
            min-width: 270px ;
            text-align: left;
            padding-top: 10px;
            padding-bottom: 10px;
        }
        #flotLine5  {
            height: 105px;
        }

        #flotBarChart {
            height: 150px;
        }
        #cellPaiChart{
            height: 160px;
        }

    </style>
</head>

<body>
<!-- Left Panel -->
<aside id="left-panel" class="left-panel">
    <nav class="navbar navbar-expand-sm navbar-default">
        <div id="main-menu" class="main-menu collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <li class="active">
                    <a href="index.html"><i class="menu-icon fa fa-laptop"></i>首页 </a>
                </li>
                <li class="active">
                    <a href="game.html"><i class="menu-icon fa fa-cogs"></i>游戏管理 </a>
                </li>
                <li class="active">
                    <a href="invest.html"><i class="menu-icon fa fa-fort-awesome"></i>充值管理 </a>
                </li>
                <li class="active">
                    <a href="achievement.html"><i class="menu-icon fa fa-pie-chart"></i>业绩管理 </a>
                </li>
                <li class="active">
                    <a href="personal.html"><i class="menu-icon fa fa-line-chart"></i>个人中心 </a>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </nav>
</aside>
<!-- /#left-panel -->
<!-- Right Panel -->
<div id="right-panel" class="right-panel">
    <!-- Header-->
    <header id="header" class="header">
        <div class="top-left">
            <div class="navbar-header">
                <span style="color: darkslateblue;">游戏平台管理 </span>
                <a class="navbar-brand hidden" href="./"><img src="images/logo2.png" alt="Logo"></a>
                <a id="menuToggle" class="menutoggle"><i class="fa fa-bars"></i></a>
            </div>
        </div>
        <div class="top-right">
            <div class="header-menu">
                <div class="user-area dropdown float-right">
                    <a href="#" class="dropdown-toggle active" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <img class="user-avatar rounded-circle" src="images/admin.jpg" alt="User Avatar">
                    </a>

                    <div class="user-menu dropdown-menu">
                        <a class="nav-link" onclick="logoutEvent()" href="#"><i class="fa fa-power -off"></i>注销登陆</a>
                    </div>
                </div>

            </div>
        </div>
    </header>
    <!-- /#header -->
    <!-- Content -->
    <div class="content">
        <!-- Animated -->
        <div class="animated fadeIn">
            <!--  Traffic  -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div style='text-align: center;'>
                            <div class="alert alert-primary">
                                <strong>业绩信息编辑</strong>
                            </div>
                        </div>
                        <div>
                            <form id="formId">
                                <input name="achievementId" type="hidden">
                                <div class="form-group">
                                    <label style="margin-left: 50px;" for="accountId">用户id:</label>
                                    <input type="number" name="accountId" class="form-control" id="accountId">
                                </div>
                                <div class="form-group">
                                    <label style="margin-left: 50px;" for="gameId">游戏id:</label>
                                    <input type="number" name="gameId" class="form-control" id="gameId">
                                </div>
                                <div class="form-group">
                                    <label style="margin-left: 50px;" for="statisticsTime">统计时间:</label>
                                    <input type="date" name="statisticsTime" class="form-control" id="statisticsTime">
                                </div>
                            </form>
                        </div>
                        <div style='margin-left: 10px;text-align: center;padding-bottom: 20px;'>
                            <button type="button" class="btn btn-primary" onclick="save()">保存</button>
                            <button type="button" class="btn btn-secondary" onclick="canle()">取消</button>
                        </div>

                    </div>
                </div><!-- /# column -->
            </div>
            <!--  /Traffic -->
            <div class="clearfix"></div>
        </div>
    </div>
    <div class="clearfix"></div>
    <!-- /.site-footer -->
</div>
<div class="clearfix"></div>
<!-- /#right-panel -->

<!-- Scripts -->
<script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.4/dist/umd/popper.min.js"></script>
<script src="https://www.jq22.com/jquery/bootstrap-4.2.1.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-match-height@0.7.2/dist/jquery.matchHeight.min.js"></script>
<script src="/assets/js/main.js"></script>

<!--  Chart js -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.7.3/dist/Chart.bundle.min.js"></script>

<!--Chartist Chart-->
<script src="https://cdn.jsdelivr.net/npm/chartist@0.11.0/dist/chartist.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartist-plugin-legend@0.6.2/chartist-plugin-legend.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/jquery.flot@0.8.3/jquery.flot.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/flot-pie@1.0.0/src/jquery.flot.pie.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/flot-spline@0.0.1/js/jquery.flot.spline.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/simpleweather@3.1.0/jquery.simpleWeather.min.js"></script>
<script src="/assets/js/init/weather-init.js"></script>

<script src="https://cdn.jsdelivr.net/npm/moment@2.22.2/moment.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/fullcalendar@3.9.0/dist/fullcalendar.min.js"></script>
<script src="/assets/js/init/fullcalendar-init.js"></script>
<script src="/assets/js/initOauth.js"></script>
<!--Local Stuff-->
<script>
    let $=jQuery;
    let path="/sys/achievement";
    $(function () {
        if(sessionStorage.achievementId &&sessionStorage.achievementId !==""){
            $.get(path+"/"+sessionStorage.achievementId,function (res) {
                $.each($("#formId").find("input"),function (index,item) {
                    $(item).val(res.data[item.name]);
                });
            });
        }
    });
    function canle() {
        window.location.href="/achievement.html";
    }
    function save() {
        var results = $("#formId").serializeArray();
        var data = {};
        $.each(results,function(index,item){
            if(!data[item.name]){
                data[item.name]=item.value;
            }else{
                //name属性相同的表单，值以英文,拼接
                data[item.name]=data[item.name]+','+item.value;
            }
        });
        if(sessionStorage.achievementId &&sessionStorage.achievementId !==""){
            $.ajax({
                url:path,
                data:data,
                type:"put",
                success:function (res) {
                    window.location.href="/achievement.html";
                }
            });
        }else {
            $.post(path,data,function (res) {
                window.location.href="/achievement.html";
            });
        }

    }
    function logoutEvent(){
        sessionStorage.removeItem("token");
        window.location.href="/page-login.html";
    }
</script>
</body>
</html>
